/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javasetcollection;

import java.util.HashSet;
import java.util.Iterator;

/**
 *
 * @author human
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        HashSet<User> hs = new HashSet();
        
        for (int i=0; i<5; i++) {
            boolean add = hs.add(new User("Vasya", "Pupkin"));
            System.out.println(add);
        }
        
        Iterator<User> users = hs.iterator();
        
        while (users.hasNext()) {
            User user = users.next();
            System.out.println(user);
        }
    }
}
